using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for AdminFunction_AdminGroupUser
/// </summary>
public class AdminFunction_AdminGroupUser
{
    private dbConnection _DB = null;
    private static string _Code = "VCQV";
    public static string Code { get { return _Code; } }
	public AdminFunction_AdminGroupUser()
	{
        _DB = new dbConnection();
	}
    public int insertRecord(string sFunctionName, string sGroupUser, string sLevel,string sURL)
    {
        string sCode = bzStringClass.MD5(sGroupUser + sURL);
        SqlParameter[] p = new SqlParameter[4];
        p[0] = new SqlParameter("@FunctionName", sFunctionName);
        p[1] = new SqlParameter("@GroupUser", sGroupUser);
        p[2] = new SqlParameter("@FunctionLevel", sLevel);
        p[3] = new SqlParameter("@Code", sCode);
        return _DB.updateData("AdminFunction_AdminGroupUser_insert", p);
    }
    public int deleteRecord(string ID)
    {
        SqlParameter p = new SqlParameter("@GroupUser", ID);
        return _DB.updateData("AdminFunction_AdminGroupUser_delete", p);
    }
    public DataTable getRecord(string sFunctionName, string sGroupUser)
    {
        SqlParameter[] p = new SqlParameter[2];
        p[0] = new SqlParameter("@FunctionName", sFunctionName);
        p[1] = new SqlParameter("@GroupUser", sGroupUser);
        return _DB.getDataTable("AdminFunction_AdminGroupUser_get", p);
    }
}
